import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
// import Home from '../layout/layout.vue'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'Home',
    // component: () => import(/* webpackChunkName: "about" */ '../views/page1/index'),
    // component: Home,
    redirect: '/page1',
    children: [
      {
        path: 'page1',
        name: 'page1',
        component: () => import(/* webpackChunkName: "about" */ '../views/page1/index'),
      },
      {
        path: 'page2',
        name: 'page2',
        component: () => import(/* webpackChunkName: "about" */ '../views/page2/index'),
      },
    ]
  }
//   {
//     path: '/login',
//     name: 'Login',
//     // route level code-splitting
//     // this generates a separate chunk (about.[hash].js) for this route
//     // which is lazy-loaded when the route is visited.
//     component: () => import(/* webpackChunkName: "about" */ '../views/login/login.vue')
//   },
//   {
//     path: '/404',
//     component: () => import('../views/404/404.vue')
//   },
//   { path: '/:pathMatch(.*)*', 
//     redirect: '/404'
//  },
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
